<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <cpn v-show="isShow"></cpn>
</div>

<template id="cpn">
  <div>
    <h2>我是子组件</h2>
    <p>我是内容，zk</p>
    <button v-show="isShow">按钮</button>
  </div>
</template>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
  const vue = new Vue({
    el:"#app",
    data:{
      message:'hello,zk ',
      isShow:true
    },
    components:{
      cpn:{
        template:'#cpn',
        data(){
          return{
            isShow:false
          }
        }
      }
    }
  })
</script>
</body>
</html>
